feat(search): add cpu subcommand and wide mode to brev search#289
feat(search): add cpu subcommand and wide mode to brev search#289
Conversation
|
Right now we are showing a bunch of Azure CPUs, I think this is disabled at the brev-deploy layer. We should wait till done |
nvidia-smi and system_profiler can be slow. Wrap getGPUInfo in a goroutine with a 100ms deadline so it never blocks CLI responsiveness.
Restructure `brev search` into gpu/cpu subcommands: - `brev search` / `brev search gpu` - GPU instances (default, backwards compatible) - `brev search gpu --wide` - GPU instances with RAM and ARCH columns - `brev search cpu` - CPU-only instances via ?include_cpu=true API param CPU search has dedicated columns (TYPE, PROVIDER, VCPUs, RAM, ARCH, DISK, $/GB/MO, BOOT, FEATURES, $/HR) and filters (--min-ram, --arch). Shared filters (--provider, --min-vcpu, --min-disk, --max-boot-time, --stoppable, --rebootable, --flex-ports, --sort) work across both modes. Piping into `brev create` works for both GPU and CPU table output.
Move --min-ram and --arch from CPU-dedicated flags to shared flags so they are available on all search subcommands (gpu, cpu, and parent).
- Fix gofumpt formatting - Remove unused terminal parameter from displayCPUTable - Reduce cyclomatic complexity of SortInstances using map-based dispatch
9c5b92a to
b3fa7ad
Compare
Show GPU name (e.g. A100, H100) in brev ls table output and JSON. Fetch instance types concurrently with workspaces for no added latency. Correctly classify instances as gpu/cpu based on actual GPU support. Remove misleading '(gpu)' suffix from instance type display.
Add CPU search examples, filters reference, and common patterns. Update trigger keywords and descriptions to include CPU instances.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #289 +/- ##
==========================================
- Coverage 13.10% 12.24% -0.86%
==========================================
Files 112 116 +4
Lines 14480 15774 +1294
==========================================
+ Hits 1898 1932 +34
- Misses 12349 13605 +1256
- Partials 233 237 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
this is solved |
|
|
||
| // getInstanceTypeAndKind returns the instance type and kind (gpu/cpu) | ||
| func getInstanceTypeAndKind(w entity.Workspace) (string, string) { | ||
| func getInstanceTypeAndKind(w entity.Workspace, gpuLookup map[string]string) (string, string) { |
There was a problem hiding this comment.
This function will return "cpu" in the event of on API failure or if the instance type is unknown
Summary
brev searchintogpuandcpusubcommands (brev searchdefaults to GPU for backwards compatibility)brev search cputo find CPU-only instances via?include_cpu=trueAPI endpoint--wideflag to GPU search that shows RAM and ARCH columns--min-vcpufilter across both modes--min-ram,--arch) and columns (TYPE, PROVIDER, VCPUs, RAM, ARCH, DISK,brev createworks for both GPU and CPU table output (verified end-to-end)Test plan
brev search— defaults to GPU search (backwards compatible)brev search gpu— identical tobrev searchbrev search gpu --wide— adds RAM + ARCH columnsbrev search cpu— shows CPU-only instancesbrev search cpu --provider gcp --sort price— filters workbrev search cpu --min-ram 64 --min-vcpu 32— numeric filters workbrev search cpu --arch x86— arch filter worksbrev search cpu --provider gcp | brev create test— pipe into create works (tested live)go test ./pkg/cmd/gpusearch/ ./pkg/cmd/gpucreate/— all tests pass